<template>
  <div class="register">
    <!-- <van-field v-model="value" placeholder="请输入用户名" /> -->
    <van-row gutter="20" class="Padding">
      <van-col span="24" class="header">
        <van-image width="100" height="auto" class="logo" :src="require('../assets/img/logo.png')" />
      </van-col>

      <van-col span="24" class="footer">
        <van-button type="info" class="registerbtn" round  size="large" @click="ios" >IOS</van-button>
        <van-button type="info" round  size="large" @click="android" >Android</van-button>
      </van-col>
    </van-row>
    <van-overlay :show="loading" >
      <div class="wrapper" @click.stop>
        <van-image class="tsPng" :src="langDate.tsPng" />
      </div>
    </van-overlay>
  </div>
</template>
<script>
/* ... */
export default {
  name: 'register',

  mixins: [],

  props: {},

  data () {
    return {
      loading: false,
      lang: 'zh', // url语言类型
      langDate: {}, // 根据语言状态赋值
      zh: {
        tsPng: require('../assets/img/zhTs.png')
      },
      us: {
        tsPng: require('../assets/img/usTs.png')
      }
    }
  },

  computed: {},

  watch: {},

  created () {
    console.log(this.lang)
    if (this.lang === 'us') {
      this.langDate = this.us
    } else if (this.lang === 'zh') {
      this.langDate = this.zh
    } else {
      this.$toast.fail('语言参数调用错误，请检查：' + this.lang)
    }
    let isWeiXin = () => { return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1 }
    if (isWeiXin()) {
      this.loading = true
    } else {
      this.loading = false
    }
  },

  mounted () {},

  destroyed () {},

  methods: {
    android () {
      window.location.href = 'https://jsms.global/appData/app.apk'
    },
    ios () {
      this.$toast.success('测试地址暂无下载包')
      // window.location.href = 'itms-services://?action=download-manifest&url=https://willing.live/iosApp/manifest.plist'
    }
  }
}
</script>

<style lang="less">
/* ... */
.register {
  width: 100%;
  height: 100%;
  background-image: url("../assets/img/background.png");
  background-size: cover;
  .Padding {
    padding: 0 20px;
    margin-left: 0px !important;
    margin-right: 0px !important;
    .header {
      padding:150px 0 30px 0;
      text-align: center;
      .logo {}
    }
    .list{
      .van-cell{
        border-bottom: 1px solid #cae1f9;
        input{
          color: #3C7FFF;
        }
        input::-webkit-input-placeholder,
        textarea::-webkit-input-placeholder {
          color: #dae6fb;
        }
      }
    }
    .footer{
      margin-top: 60px;
      .registerbtn{
        margin-bottom: 30px;
      }
    }
  }
}
.wrapper {
  height: 100%;
  text-align: right;
  .tsPng{
    width: 200px;
    height: auto;
    margin-top: 10px;
    margin-right: 10px;
  }
}
</style>
